package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.base.HLList;
import HLLib.base.HLVirtualButton;

public class HLClassVirtualButton extends HLLibClass {
    public HLClassVirtualButton(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLVirtualButton();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            ((HLVirtualButton) self).Setting(args.GetInt(0), args.GetInt(1), args.GetInt(2), args.GetInt(3), args.GetInt(4), args.GetInt(5));
            break;
        }
        case 1: {
            ((HLVirtualButton) self).pointerRefresh((HLList)args.GetObject(0));
            break;
        }
        case 2: {
            ((HLVirtualButton) self).update();
            break;
        }
        case 3: {
            if (resultOwnerObject == null) {
                ((HLVirtualButton) self).IsDown();
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLVirtualButton) self).IsDown());
            }
            break;
        }
        case 4: {
            if (resultOwnerObject == null) {
                ((HLVirtualButton) self).IsUp();
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLVirtualButton) self).IsUp());
            }
            break;
        }
        case 5: {
            if (resultOwnerObject == null) {
                ((HLVirtualButton) self).IsHold();
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLVirtualButton) self).IsHold());
            }
            break;
        }
        case 6: {
            if (resultOwnerObject == null) {
                ((HLVirtualButton) self).IsDownOrHold();
            } else {
                resultOwnerObject.SetBoolean(resultIndex, ((HLVirtualButton) self).IsDownOrHold());
            }
            break;
        }
        }
    }
}
